package org.ym.base.service;

import javax.annotation.Resource;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate4.HibernateTemplate;

public class BaseService {
	public HibernateTemplate hibernateTemplate;

	public SessionFactory sessionFactory;

	@Resource
	private void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
		this.hibernateTemplate = new HibernateTemplate(sessionFactory);
	}
	
	public Session getCurrentSession(){
		return sessionFactory.getCurrentSession();
	}
	
}
